package com.ithanwen.config;

import com.ithanwen.intercepter.MyIntercepter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Created By tony
 * <br/>Date: 2025/8/13 15:23
 * <br/>Description:
 */
@Configuration
public class IntercepterConfig implements WebMvcConfigurer {

    @Autowired
    private MyIntercepter myIntercepter;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(myIntercepter)
                .addPathPatterns("/**")
                .excludePathPatterns("/login");
    }
}
